package com.simen.connectandroid.model;

/**
 * Created on 2021/10/30 16:54.
 *
 * @author Simen
 */
public enum DeviceIpStatus {

    UP(0, "UP"), DOWN(1, "DOWN"), UNKNOWN(-1, "");

    private int value;
    private String status;

    DeviceIpStatus(int value, String status) {
        this.value = value;
        this.status = status;
    }

    public int getValue() {
        return value;
    }

    public String getStatus() {
        return status;
    }

    public static DeviceIpStatus parse(String status) {
        if (status != null) {
            if ("up".equalsIgnoreCase(status)) {
                return UP;
            } else if ("down".equalsIgnoreCase(status)) {
                return DOWN;
            }
        }
        return UNKNOWN;
    }
}
